<?php use_javascript('jquery-1.3.2.min.js') ?>
<?php use_helper ('Form','Javascript','Object') ?>

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="heading_table">
    <tr>
        <td height="30"><span class="heading">List of Total Unpaid Bills</span></td>
        <td align="right" height="30" valign="bottom">&nbsp;</td>
    </tr>
</table> 

</table> 
 
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="datagrid">
    <tr>
        <th width="5%" style="text-align:left;">Sr.</th>
        <th width="28%" style="text-align:left;">Rank/Name</th>
        <th width="27%" style="text-align:left;">Station</th>
        <th width="20%" style="text-align:left;">Total Bill</th>
        <th width="20%" style="text-align:left;">Bill Month</th>
    </tr>

<?php if (count($bills)): ?>
<?php foreach ($bills as $j => $bill) : ?>
    <tr>
        <td align="left"><?php echo $j+1;?></td>
        <td align="left"><?php echo link_to($bill->getOccupant()->getRank().' '.$bill->getOccupant()->getName(), 'Billing/detailBill?id='.Utility::EncryptQueryString($bill->getId())); ?> </td>
        <td align="left"><?php echo $bill->getStation(); ?></td>
        <td align="left">Rs. <?php echo $bill->getGrandTotal(); ?></td>
        <td align="left"><?php echo $bill->getBillingDate('M-Y'); ?></td>
        
    </tr>

<?php endforeach; ?>
    <tr>
   		<td class="last">&nbsp;</td>
    </tr>
</table>
	<?php else:?>
    <tr>
        <td colspan="5" style="background:none; text-align:center;"><?php echo "No Record Found." ?></td>
    </tr>
    </table>
    <?php endif; ?>